home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra_2 / cmd67b.zip / WOIO.H < prev    next >
C/C++ Source or Header  |  1995-07-27  |  9KB  |  283 lines

  1. /******************************************************************\
  2. *                                                                  *
  3. *           w       w                oooo                           *
  4. *           w       w  iii  n   n   o    o   n   n  eeee            *
  5. *           w       w   i   nn  n  o      o  nn  n  e               *
  6. *           w   w   w   i   n n n  o      o  n n n  eee             *
  7. *              w w w w    i   n  nn   o    o   n  nn  e               *
  8. *              w   w    iii  n   n    oooo    n   n  eeee            *
  9. *                                                                      *
  10. *     C o m m a n d   L a n g u a g e   I n t e r p r e t e r      *
  11. *                                                                      *
  12. *                                                                      *
  13. *    Written by Lucien Cinc                                         *
  14. *    Copyright (c) 1992, 1993                                       *
  15. *                                                                   *
  16. *                                                                   *
  17. *    For a complete description of all the functions in this file   *
  18. *    see the  WOIO.HLP help file. WOIO.HLP is located in the sub-   *
  19. *    directory WOIO, for example :-                                 *
  20. *                                                                  *
  21. *                    C:\WIN_ONE\WOIO\WOIO.HLP                       *
  22. *                                                                  *
  23. *    Note: To view this  file from  WinOne use the  /4 switch for   *
  24. *          command  TYPE,  since  I use  only  4 spaces  for  tab   *
  25. *          characters, for example :-                               *
  26. *                                                                  *
  27. *                    TYPE WOIO.H /4                                 *
  28. *                                                                   *
  29. \******************************************************************/
  30.  
  31. #ifndef __WOIO_H
  32. #define __WOIO_H
  33.  
  34. #include <windows.h>
  35.  
  36. /*
  37.     include stdio.h here so that the macros putchar
  38.     and getchar    can be removed!
  39. */
  40.  
  41. #include <stdio.h>
  42.  
  43. #ifndef _FFBLK_DEF
  44. #define _FFBLK_DEF
  45. struct  ffblk   {
  46.     long            ff_reserved;
  47.     long            ff_fsize;
  48.     unsigned long   ff_attrib;
  49.     unsigned short  ff_ftime;
  50.     unsigned short  ff_fdate;
  51.     char            ff_name[256];
  52. };
  53. #endif
  54.  
  55. #ifdef putchar
  56. #undef putchar
  57. #endif    /* putchar */
  58.  
  59. #ifdef getchar
  60. #undef getchar
  61. #endif    /* getchar */
  62.  
  63. #ifdef __cplusplus
  64. extern "C" {
  65. #endif  /* __cplusplus */
  66.  
  67. /*
  68.     The system colours below should always be
  69.     used instead of the fix colours. The system
  70.     colours allow the user to change to 
  71.     different colour schemes.
  72. */
  73.  
  74. #define COL_FILENAME    (char )144    /* system text colours */
  75. #define COL_HIGHFNAME    (char )145
  76. #define COL_NUMBER        (char )146
  77. #define COL_TEXT        (char )147
  78. #define COL_HIGHTEXT    (char )148
  79. #define COL_BOLDTEXT    (char )149
  80. #define COL_ENVNAME        (char )150
  81. #define COL_ENVSTR        (char )151
  82. #define COL_ERROR        (char )152
  83. #define COL_LHS            (char )153
  84. #define COL_HIGHLHS        (char )154
  85. #define COL_RHS            (char )155
  86. #define COL_FILEDATE    (char )156
  87. #define COL_FILETIME    (char )157
  88. #define COL_FILEATTRIB    (char )158
  89. #define COL_FILEDESC    (char )159
  90.  
  91. #define BLACK            (char )128   /* fixed text colours */
  92. #define    RED             (char )129
  93. #define GREEN            (char )130
  94. #define BLUE            (char )131
  95. #define YELLOW             (char )132
  96. #define MAGENTA            (char )133
  97. #define CYAN            (char )134
  98. #define WHITE            (char )135
  99. #define LIGHTGRAY        (char )136
  100. #define LIGHTRED        (char )137
  101. #define LIGHTGREEN        (char )138
  102. #define LIGHTBLUE        (char )139
  103. #define BROWN            (char )140
  104. #define LIGHTMAGENTA    (char )141
  105. #define LIGHTCYAN        (char )142
  106. #define DARKGRAY        (char )143
  107.  
  108. /*******************************\
  109. *                                *
  110. *        Control Functions        *
  111. *                                *
  112. \*******************************/
  113.  
  114. #define BUFFERED    1        /* screen output */
  115. #define UNBUFFERED    0
  116.  
  117. void screen(int flag);                    /* buffered screen output */
  118. void yield(void);                        /* alow other tasks to multitask */
  119.  
  120. /*******************************\
  121. *                                *
  122. *     Screen Output Functions    *
  123. *                                *
  124. \*******************************/
  125.  
  126. int  printf(const char *fmt, ...);      /* printf formated output */
  127. int  puts(const char *s);                /* string output + CR-LF */
  128. int  putchar(const int c);                /* character output    */
  129. int  putch(int c);                        /* character output    */
  130. void perror(const char *msg);            /* display an error message    */
  131. void textcolor(int col);                /* set the text colour */
  132.  
  133. void clrscr(void);                        /* clear the screen */
  134. void clreol(void);                        /* clear till end of line */
  135. void gotoxy(int x, int y);                /* position cursor on screen */
  136. int  wherex(void);                        /* location of caret (horizontal) */
  137. int  wherey(void);                        /* location of caret (vertical) */
  138.  
  139. int scrwidth(void);                        /* screen width in characters */
  140. int scrheight(void);                    /* screen height in character */
  141.  
  142. void scrflush(void);                    /* update the screen */
  143. void insline(int line);                    /* insert a line on the screen */
  144. void delline(int line);                    /* delete a line on the screen */
  145. void scroll(int start, int end, int num);    /* scroll area of screen */
  146.  
  147.  
  148. char *atoc(char *number);                /* insert comma's into a number */
  149.  
  150. /*******************************\
  151. *                                *
  152. *         Input Functions        *
  153. *                                *
  154. \*******************************/
  155.  
  156. int  scanf(const char *fmt, ...);        /* scanf formated input    */
  157. char *gets(char *s);                    /* get a string    */
  158. int  getchar(void);                        /* get a character */
  159. int  getch(void);                        /* get a character no echo */
  160.  
  161. /*******************************\
  162. *                                *
  163. *     Command Line Functions        *
  164. *                                *
  165. \*******************************/
  166.  
  167. int  argc(void);                        /* number of arguments */
  168. char *argv(int index);                     /* get an argument */
  169. int  argn(void);                        /* number of switches */
  170. char *args(void);                        /* get all switches */
  171.  
  172. char *argpath(int index);                /* get path argument */
  173. char *argabs(int index);                /* get absolute path argument */
  174. char *argtail(void);                    /* get command line tail */
  175.  
  176. /*******************************\
  177. *                                *
  178. *       Status Bar Functions        *
  179. *                                *
  180. \*******************************/
  181.  
  182. void limit(unsigned long upper);        /* status bar upper limit */
  183. void inc(unsigned long value);            /* status bar increment by value */
  184. void empty(void);                        /* empty status bar */
  185.  
  186. /*******************************\
  187. *                                *
  188. *  File manipulation Functions    *
  189. *                                *
  190. \*******************************/
  191.  
  192. #define INC_BYTE    0    // u_flag's for status bar updating
  193. #define INC_ONE        1
  194. #define INC_NONE    2
  195.  
  196. #define O_OPEN        0    // o_flag's for opening dest file
  197. #define O_CREATE    1
  198. #define O_CREATNEW  2
  199.  
  200. long filesize(char *path);
  201. long filecpy(char *dst, char *src, int o_flag, int u_flag);
  202. long filecat(char *dst, char *src, int u_flag);
  203.  
  204. long filencpy(char *dst, char *src, long num, long offset, int o_flag, int u_flag);
  205. long filencat(char *dst, char *src, long num, long offset, int u_flag);
  206.  
  207. /*******************************\
  208. *                                *
  209. *       File Name Functions        *
  210. *                                *
  211. \*******************************/
  212.  
  213. #define ATT_RHSDA     (unsigned int )(FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_DIREC|FA_ARCH)
  214. #define ATT_RHSA     (unsigned int )(FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCH)
  215.  
  216. int fillfile(char *path, unsigned int attr);    /* block file fill */
  217. BOOL getfile(int index, struct ffblk *pff);        /* get file ffblk */
  218. char *getfilepath(int index);                     /* get file path, may not be a fully qualified path */
  219. char *getfilename(int index);                    /* get file name */
  220. char *padfilename(char *path);                  /* pad a filename for displaying */
  221.  
  222. int istextfile(char *path);                        /* TRUE when path is a text file */
  223.  
  224. /*******************************\
  225. *                                *
  226. *          Path Functions            *
  227. *                                *
  228. \*******************************/
  229.  
  230. int fillpath(char *path);                /* block path fill */
  231. int fillpathall(void);                    /* block path fill for all drives */
  232. void freepaths(void);                    /* free paths */
  233. char *getpath(int index);                /* get a path */
  234.  
  235. /*******************************\
  236. *                                *
  237. *   Unix conversion functions   *
  238. *                                *
  239. \*******************************/
  240.  
  241. int isunix(void);                        /* unix mode flag */
  242. char *tounix(char *cmd);                /* convert dos command to unix */
  243. char *todos(char *cmd);                    /* convert unix command to dos */
  244.  
  245. /*******************************\
  246. *                                *
  247. *  File Description Functions    *
  248. *                                *
  249. \*******************************/
  250.  
  251. char *getdesc(char *path);                /* get a file description */
  252. int setdesc(char *path, char *str);        /* set a file description */
  253. int deldesc(char *path);                /* delete a file description */
  254.  
  255. /*******************************\
  256. *                                *
  257. *    Environment Functions        *
  258. *                                *
  259. \*******************************/
  260.  
  261. char *getenvironment(char *name);        /* get WinOne environment variable */
  262. int putenvironment(char *name);            /* set WinOne environment variable */
  263.  
  264. /*******************************\
  265. *                                *
  266. *       Global Variables        *
  267. *                                *
  268. \*******************************/
  269.  
  270. HINSTANCE gethinst(void);
  271.  
  272. extern char *arg_v[];            /* argv */
  273. extern int arg_c;                /* argc */
  274. extern int errcnt;                /* perror counter */
  275.  
  276. extern int main(void);    /* program entry point */
  277.  
  278. #ifdef __cplusplus
  279. }
  280. #endif  /* __cplusplus */
  281.  
  282. #endif    /* __WOIO_H */
  283.